# $Id: Makefile,v 1.9 1998/07/20 22:50:27 ericb Exp $
# Copyright (C) 1996 - 1998, Hewlett-Packard Company, all rights reserved.
# Written by Eric Backus

# Makefile for the E1432 to E1562 LIF throughput eavesdrop example
# programs.  These programs were highly leveraged from the throughput
# directory, then modified to deal with eavesdrop monitoring.

E1432_BASE	= /opt/e1432
E1432_EAVES	= $(E1432_BASE)/examples/eavesdrop

E1432_BUILD	= ../..
E1432_INC	= $(E1432_BUILD)/hostlib
E1432_LIB	= $(E1432_BUILD)/hostlib

# Specify the base directories for the needed include files and libraries.
E1562_BASE	= /opt/e1562
E1562_INC	= $(E1562_BASE)/include
XPLOT_BASE	= $(E1432_BUILD)/demo

CC	= cc
LD	= $(CC)
CFLAGS	= -Aa +e -D_HPUX_SOURCE -I $(E1432_INC)\
		-I $(E1562_INC) -I $(XPLOT_BASE)  +w1
LDFLAGS = -L$(E1432_BASE)/lib -L$(E1562_BASE)/lib -L/usr/lib/X11R5 -s
LNFLAGS	= $(CFLAGS) -x
LNLIBS	= $(E1432_LIB)/llib-l1432.ln $(XPLOT_BASE)/llib-lxplot.ln -lm
LDLIBS	= -l1432 -l1562fs $(XPLOT_BASE)/xplot.a -lX11 -lsicl -lm
CFILES	= e1562tput.c pbck.c tput.c tputresamp.c
HFILES	= e1562tput.h tputhdr.h
TFILES	= e1562tput.c e1562tput.h pbck.c tputhdr.h
OBJS	= $(CFILES:.c=.o)

TARGETS	= pbck tput tputresamp

all:	$(TARGETS)

clean:
	rm -f *.o *~ lint core a.out $(TARGETS) $(TFILES)

install:	all
	if [ ! -d $(E1432_EAVES) ]; then\
		mkdir $(E1432_EAVES); fi
	cp -f README Makefile $(CFILES) $(HFILES)\
		$(TARGETS) $(E1432_EAVES)
	chmod -w $(E1432_EAVES)/*

lint:	$(CFILES) $(HFILES)
	lint $(LNFLAGS) $(CFILES) $(LNLIBS) > lint

$(OBJS):	$(HFILES)

$(TFILES):
	cp -f ../throughput/$@ .

# Throughput eavesdrop application
tput:	tput.o e1562tput.o
	$(LD) $(LDFLAGS) -o $@ tput.o e1562tput.o $(LDLIBS)

# Throughput eavesdrop with resampling
tputresamp:	tputresamp.o e1562tput.o
	$(LD) $(LDFLAGS) -o $@ tputresamp.o e1562tput.o $(LDLIBS)

# Throughput post-processing application
pbck:	pbck.o e1562tput.o
	$(LD) $(LDFLAGS) -o $@ pbck.o e1562tput.o $(LDLIBS)
